package com.guyu.app.common.remote.request;

import com.guyu.common.core.entity.BaseRequest;
import com.guyu.common.core.exception.BaseException;
import com.guyu.common.core.exception.code.ErrorCodeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.dromara.hutool.core.text.StrUtil;


@Data
public class MapInputTipsReq implements BaseRequest {

    @Schema(description = "查询关键词")
    private String keywords;

    @Schema(description = "经度值(x) 可选值")
    private Double lng;

    @Schema(description = "纬度值(y) 可选值")
    private Double lat;

    @Schema(description = "搜索城市 可选值")
    private String city;

    public void check() {
        this.keywords = StrUtil.trim(keywords);
        if (StrUtil.isEmpty(keywords)) {
            throw BaseException.create(ErrorCodeEnum.MISSING_PARAMS, "请输入查询关键词");
        }
        this.city = StrUtil.trim(city);
    }

}
